﻿@using MyBlog2.Models
@model MyBlog2.ViewModels.ArticleQueryViewModel

@{
    ViewData["Title"] = "搜索";
    Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml";

    var articleClassify = ViewBag.classify as List<ArticleClassify>;
}

<!-- 搜索表单 -->
<form method="post" asp-route="Search">
    <div class="form-row align-items-center">
        <div class="col-sm-3 my-1">
            <label class="sr-only">标题</label>
            <input type="text" class="form-control" id="Title" placeholder="标题" asp-for="QueryArticleTitle">
        </div>
        <div class="col-sm-3 my-1">
            <label class="sr-only">分类</label>
            <div class="input-group">
                <select class="form-control mr-sm-2" id="articleClassify" asp-for="QueryArticleClassifyId">
                    <option value="-1" selected>请选择...</option>
                    @foreach (var a in articleClassify)
                    {
                        <option value="@a.Id">@a.Name</option>
                    }
                </select>
            </div>
        </div>

        <div class="col-auto my-1">
            <button  type="submit" class="btn btn-primary">查询</button>
        </div>
    </div>
</form>